home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / AECUR100.ARJ / BOXWIN.C < prev    next >
C/C++ Source or Header  |  1990-03-08  |  881b  |  41 lines

  1. /*----------------------------------------------------------------------
  2.  *
  3.  *  boxwin.c
  4.  *
  5.  *  copyright (c) 1987,88,89,90 J. Alan Eldridge
  6.  *
  7.  *  display a boxed window on the screen
  8.  *  
  9.  *----------------------------------------------------------------------
  10.  */
  11.  
  12. #include "curses.h"
  13.  
  14. int
  15. boxwin(wptrs, lines, cols, orgy, orgx, v, h)
  16. WINDOW  *wptrs[2];
  17. int     lines, cols, orgy, orgx, v, h;
  18. {
  19.     WINDOW  *frame,
  20.             *win;
  21.  
  22.     frame = newwin(lines + 2, cols + 2, orgy - 1, orgx - 1);
  23.  
  24.     if (frame)
  25.         win = subwin(frame, lines, cols, orgy, orgx);
  26.     else
  27.         return ERR;
  28.         
  29.     if (win) {
  30.         box(frame, v, h);
  31.         wrefresh(frame);
  32.         wptrs[0] = frame;
  33.         wptrs[1] = win;
  34.         return OK;
  35.     } else {
  36.         delwin(frame);
  37.         wptrs[0] = wptrs[1] = NULL;
  38.         return ERR;
  39.     }
  40. }
  41.